home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Tools (InfoMagic)
/
Internet Tools.iso
/
dos_win
/
winsock
/
maillist
/
94-05.Z
/
94-05
/
000131_news@bigblue.oit.unc.edu_Fri May 9 21:13:45 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-05-31
|
5KB
Received: from bigblue.oit.unc.edu by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
id AA28631; Tue, 10 May 1994 15:44:56 -0400
Received: by bigblue.oit.unc.edu (AIX 3.2/UCB 5.64/4.03)
id AA10355; Tue, 10 May 1994 15:27:14 -0400
Received: from GATEWAY by bigblue with netnews
for winsock@sunsite.unc.edu (winsock@sunsite.unc.edu)
To: winsock@sunsite.unc.edu
Date: 10 May 1994 04:13:45 -0700
From: craign@teleport.com (Craig R. Nelson)
Message-Id: <2qnq99$t6o@linda.teleport.com>
Organization: Teleport - Portland's Public Access (503) 220-1016
Sender: ses
Subject: Closing/Killing a socket
Hi there!
I know. Hard to believe. An actual windows sockets programming question.
My question is this.
I am running Chameleon 4.004. I'm in the process of doing an nntp news
client-reader. One of the nntp commands is LIST\r\n and, as you might
expect, it fetches the whole list of newsgroups available from your
server. I would ike a gracefull way of killing this reception of the list
in midstream.
This is entirely being done with non-blocking asynchronous socket calls.
Using BC++ 4.0 and multiple inheritance response tables makes that part a
piece of cake. This is essentiall how it is working. Keep in mind that
this *is* C++ and therefore might look a litle strange. Let is suffice to
say that Manager is a class that receives socket notifications, and sock
is a socket object with all the underlying socket calls implemented within:
Manager::NotifyConnect()
{
sock.AsyncSelect( FD_READ | FD_CLOSE );
sock.send( "LIST\r\n" );
};
Manager::NotifyRead()
{
int nChars = sock.recv( recvBuffer, sizeof(recvBuffer)-1 );
recvBuffer[ nChars ] = 0;
..process received characters..
};
The trick part is in the CmCancel, a callback that responds to the
cancel=button of the loadList dialog. It is the only control (and the
only way) to close the dialog. I have tried various ways to kill the
socket from the TCP stack, the most horrid of which is:
void Manager::CmCancel()
{
sock.AsyncSelect( 0 );
sock.shutdown( 2 );
sock.close();
TDialog::CmCancel();
}
But every time I do this the socket always ends up with a FIN ACKed state
and hangs around even though the close was successfull (so closesocket()
tells me).
Is there something I am missing on closing down a socket (possibly
rudely) that is recv'ing hordes of data? Should I be doing something with
ioctlsocket()?
If the list is run to completion (which takes up to a minute over a 14kb
line) and then the dialog (and socket) are closed all is well and the
socket goes into quiet mode followed by falling out of the stack. I guess
what I'm asking is how can I tell the news server to quit sending data
since I don't want it anymore? Or is this even needed?
Thanks for all the help. Imagine that. An actual programming question in
the alt.winsock forum ... :-)
-- Craig
--
[]----------------------------------------------------[]
| Craig Nelson "I've upped my standards. Up Yours." |
| craign@teleport.com as vague a .signature can get. |
[]----------------------------------------------------[]
From news@bigblue.oit.unc.edu Tue May 10 11:36:00 1994
Received: from bigblue.oit.unc.edu by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
id AA04152; Tue, 10 May 1994 16:14:56 -0400
Received: by bigblue.oit.unc.edu (AIX 3.2/UCB 5.64/4.03)
id AA16802; Tue, 10 May 1994 15:54:48 -0400
Received: from GATEWAY by bigblue with netnews
for winsock@sunsite.unc.edu (winsock@sunsite.unc.edu)
To: winsock@sunsite.unc.edu
Date: Tue, 10 May 1994 11:36:00 GMT
From: WhiskerP@lgwct.logica.com (Peter Whisker)
Message-Id: <WhiskerP.257.2DCF719E@lgwct.logica.com>
Organization: Logica DCG Ltd.
Sender: ses
Subject: NDIS Slip or PPP driver ?????
Anybody know of an NDIS (2 or 3) compliant SLIP or PPP driver.
It would be nice to be able to connect WFW 3.11 to a dial-in SLIP or PPP port
and be able to see the whole network.
The RAS (NETBeui) which comes with WFW is not what I would want to use.
Thanks
Peter
~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Peter Whisker | Internet: WhiskerP@lgwct.logica.com
Logica DCG Ltd, | X400 : WhiskerP/O=LG/OU=LGWCT/P=LOGICA/A=TMAILUK/C=GB
Cobham, Surrey | "Opinions are mine, not Logica's"
Great Britain | "B'shin tuairim phearsanta, nach leargas Logica"
~~~~~~~~~~~~~~~~~~~'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~